import {mathAdapter} from "../apiModel/adapter/adapterInterface/util/IMathAdapter";


export default class MathUtil {

    static getPI(): number {
        return mathAdapter.adapter.getPI();
    }

    /**
     * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
     * For example, the absolute value of -5 is the same as the absolute value of 5.
     * @param x A numeric expression for which the absolute value is needed.
     */
    static abs(x: number): number {
        return mathAdapter.adapter.abs(x);
    };

    static acos(x: number): number {
        return  mathAdapter.adapter.acos(x);
    };

    static asin(x: number): number {
        return  mathAdapter.adapter.asin(x);
    };

    static atan(x: number): number {
        return  mathAdapter.adapter.atan(x);
    };

    static toNumber(obj: any): number {
        return mathAdapter.adapter.toNumber(obj);
    }

    static toString(obj: any): string {
        return mathAdapter.adapter.toString(obj);
    }


    static atan2(y: number, x: number): number {
        return  mathAdapter.adapter.atan2(y, x);
    };

    static ceil(x: number): number {
        return mathAdapter.adapter.ceil(x);
    };

    static cos(x: number): number {
        return  mathAdapter.adapter.cos(x);
    };

    static floor(x: number): number {
        return mathAdapter.adapter.floor(x);
    };

    static random(min: number, max: number): number {
        return mathAdapter.adapter.random(min, max);
    };

    static randomReal(min: number, max: number): number {
        return mathAdapter.adapter.randomReal(min, max);
    };

    static round(x: number): number {
        return mathAdapter.adapter.round(x);
    };

    static sin(x: number): number {
        return mathAdapter.adapter.sin(x);
    };
    static min(...values: number[]): number {
        return mathAdapter.adapter.min(...values);
    };
    static max(...values: number[]): number {
        return mathAdapter.adapter.max(...values);
    };

    static sqrt(x: number): number {
        return mathAdapter.adapter.sqrt(x);
    };

    static tan(x: number): number {
        return mathAdapter.adapter.tan(x);
    };
    static toFixed(number: number, fixNum: number) {
        return mathAdapter.adapter.toFixed(number, fixNum);
    }

    static squareRoot(x: number) {
        return SquareRoot(x);
    }
}